"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("@nestjs/common");
var path = require("path");
var PathService = /** @class */ (function () {
    function PathService() {
    }
    PathService.prototype.dirname = function (p) {
        return path.dirname(p);
    };
    PathService.prototype.extname = function (p) {
        return path.extname(p);
    };
    PathService.prototype.format = function (pathObject) {
        return path.format(pathObject);
    };
    /**
     * 判定 p 是否为一个绝对路径
     * @param p路径
     */
    PathService.prototype.isAbsolute = function (p) {
        return path.isAbsolute(p);
    };
    PathService.prototype.join = function () {
        var paths = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            paths[_i] = arguments[_i];
        }
        return path.join.apply(path, paths);
    };
    PathService.prototype.normalize = function (p) {
        return path.normalize(p);
    };
    PathService.prototype.parse = function (p) {
        return path.parse(p);
    };
    PathService.prototype.relative = function (from, to) {
        return path.relative(from, to);
    };
    PathService.prototype.resolve = function () {
        var pathSegments = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            pathSegments[_i] = arguments[_i];
        }
        return path.resolve.apply(path, pathSegments);
    };
    Object.defineProperty(PathService.prototype, "sep", {
        get: function () {
            return path.sep;
        },
        enumerable: true,
        configurable: true
    });
    PathService = __decorate([
        common_1.Injectable()
    ], PathService);
    return PathService;
}());
exports.PathService = PathService;
